package com.zeny.coding.controller.web;

import com.zeny.coding.dto.CategoryDto;
import com.zeny.coding.dto.Response;
import com.zeny.coding.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <h2>分类</h2>
 *
 * @Author Zeny
 */
@SuppressWarnings("all")
@RestController
@RequestMapping("/coding/web/category")
public class WebCategoryController {

    @Autowired
    private CategoryService categoryService;

    /**
     * <h2>查询所有分类：树形菜单、所有的</h2>
     * @param
     **/
    @GetMapping("/all")
    public Response all() {
        Map<String, List<CategoryDto>> map = this.categoryService.findMapAll();
        return new Response().success().data(map);
    }
}
